package online.longzipeng.householdbillssystem.common.utils;

import online.longzipeng.householdbillssystem.common.result.ResponseEnum;
import online.longzipeng.householdbillssystem.common.result.Result;

/**
 * @Author: lzp
 * @Date: 2021/2/7 22:55
 * 结果集处理工具
 */
public class ResponseUtils{

    /**
     * 设置成功响应的消息并返回
     * @param message
     * @return
     */
    public static Result successResponse(String message){
        Result result = new Result(ResponseEnum.SUCCESS);
        result.setMessage(message);
        return result;
    }

    /**
     * 设置成功响应的消息和对象并返回
     * @param message
     * @return
     */
    public static Result successResponse(String message,Object data){
        Result result = new Result(ResponseEnum.SUCCESS);
        result.setMessage(message);
        result.setData(data);
        return result;
    }

}
